package com.cqut.hfh.ordering.controller;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import javax.servlet.http.HttpServletRequest;

/**
 * @author LJH
 * @date 2019/6/22-21:21
 */
@ControllerAdvice
public class ExceptionController {


    //@ResponseBody
    @ExceptionHandler(Exception.class)
    public String handlerMaxUploadSizeExceededException(Exception e, HttpServletRequest request){
        //处理异常的方法

        System.out.println("处理异常.....");

        return "redirect:" + request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
                    + request.getContextPath() + "/" + "pages/wzw/error.jsp";
    }

}
